/*     */ package com.lmpop.trade.temperatureinf;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class TemperatureinfInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public TemperatureinfInfo()
/*     */   {
/*  15 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  24 */     Temperatureinf temperatureinf = new Temperatureinf();
/*  25 */     temperatureinf.setInsertId(map.getInt("InsertId"));
/*  26 */     temperatureinf.setDeviceNo(map.getInt("DeviceNo"));
/*  27 */     temperatureinf.setTemperature(map.getString("Temperature"));
/*  28 */     temperatureinf.setCreateTime(map.getString("CreateTime"));
/*     */ 
/*  30 */     String result_code = "0";
/*     */     try {
/*  32 */       insert(dbmMgr, temperatureinf);
/*     */     } catch (ApplicationException e) {
/*  34 */       e.printStackTrace();
/*  35 */       result_code = "1";
/*     */     }
/*  37 */     map.setString("result_code", result_code);
/*  38 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Temperatureinf temperatureinf)
/*     */     throws ApplicationException
/*     */   {
/*  47 */     dbmMgr.update("insertTemperatureinf", temperatureinf);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  57 */     String pkid_string = map.getString("pkid");
/*  58 */     String result_code = "0";
/*     */     try {
/*  60 */       if (!pkid_string.equals("")) {
/*  61 */         String[] pkStr = pkid_string.split("\\|");
/*  62 */         for (int i = 0; i < pkStr.length; i++) {
/*  63 */           if (pkStr[i].equals("")) continue; delete(dbmMgr, pkStr[i]);
/*     */         }
/*     */       }
/*     */     } catch (ApplicationException e) {
/*  67 */       e.printStackTrace();
/*  68 */       result_code = "1";
/*     */     }
/*  70 */     map.setString("result_code", result_code);
/*  71 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, String pkid)
/*     */     throws ApplicationException
/*     */   {
/*  80 */     dbmMgr.update("deleteTemperatureinf", pkid);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  89 */     Temperatureinf temperatureinf = new Temperatureinf();
/*  90 */     temperatureinf.setInsertId(map.getInt("InsertId"));
/*  91 */     temperatureinf.setDeviceNo(map.getInt("DeviceNo"));
/*  92 */     temperatureinf.setTemperature(map.getString("Temperature"));
/*  93 */     temperatureinf.setCreateTime(map.getString("CreateTime"));
/*     */ 
/*  95 */     String result_code = "0";
/*     */     try {
/*  97 */       update(dbmMgr, temperatureinf);
/*     */     } catch (ApplicationException e) {
/*  99 */       e.printStackTrace();
/* 100 */       result_code = "1";
/*     */     }
/* 102 */     map.setString("result_code", result_code);
/* 103 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Temperatureinf temperatureinf)
/*     */     throws ApplicationException
/*     */   {
/* 112 */     dbmMgr.update("updateTemperatureinf", temperatureinf);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 122 */     Hashtable temperatureinf = (Hashtable)obj;
/* 123 */     if (start == 0)
/* 124 */       start = 0;
/*     */     else {
/* 126 */       start = (start - 1) * limit;
/*     */     }
/* 128 */     temperatureinf.put("start", Integer.valueOf(start));
/* 129 */     temperatureinf.put("limit", Integer.valueOf(limit));
/* 130 */     return this.queryList.getList("getListByTemperatureinfPage", temperatureinf);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 141 */     Hashtable temperatureinf = (Hashtable)obj;
/* 142 */     List list = this.queryList.getList("getCountByObjTemperatureinf", temperatureinf);
/* 143 */     int count = 0;
/* 144 */     if ((list != null) && (list.size() > 0)) {
/* 145 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 146 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 147 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 150 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 160 */     return this.queryList.getList("getTemperatureinfByPk", pk);
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.temperatureinf.TemperatureinfInfo
 * JD-Core Version:    0.6.0
 */